<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<style type="text/css">
.layer{
	width:600px;
 	padding: 5px;
 	border-left:1px solid gray;
 	border-right:1px solid gray;
 	border-bottom:1px solid gray;
 	
}
#title{
font-weight: bold;
border-top:1px solid gray;
}
#info{
font-size: 13px;
}
#content{
min-height:300px; 
height:auto;
}
#comment{
min-height:300px; 
height:auto;
}

</style>

<div id="title" class="layer">
${requestScope.freeBoard.code }.${requestScope.freeBoard.title }
</div>
<div id="info" class="layer">
작성자 : ${requestScope.freeBoard.name } | 조회수 : ${ requestScope.freeBoard.hit} | 작성일시 : ${requestScope.freeBoard.insertDate}
</div>
<div id="content" class="layer">
${requestScope.freeBoard.contents }
</div>

<script type="text/javascript" src="/${initParam.rootPath }/script/commentScript.js "></script>

<form action="/${initParam.rootPath }/freeboard/comment_writeContent.do" method="post" onsubmit="return writeFormCheck(this);">

<input type='hidden' name="code" value="${requestScope.freeBoard.code }">
<input type="hidden" name="page" value="${param.page}">
<table style="width:550px">
 <tr>
	<td>작성자</td>
	<td><input type="text" name="name" value="${sessionScope.login_info.id }" readonly="readonly"></td>
 </tr>
 <tr>
	<td colspan=2>
		<textarea cols="50" rows="5" name="contents"></textarea>
	</td>
 </tr>
 <tr>
 	<td colspan="2" align="center">
	 	<input type="submit" value="등록">
	 </td>
 </tr>
 </table>
 </form>


<div id="comment" class="layer">
<table border="1">
	<c:forEach items="${requestScope.freeBoard.comment }" var="free">
		<tr>
			<td>→${free.name }</td>
			<td>${free.contents }</td>
			<td>${free.insertDate }</td>
			<td>
<a href="/${initParam.rootPath }/freeboard/comment_deleteContent.do?reCode=${free.reCode}&code=${requestScope.freeBoard.code}">삭제</a>
			</td>
		</tr>	
	</c:forEach>
</table>
</div>




<div style="margin-top: 30px">
	<a href="/${initParam.rootPath }/freeboard/modifyForm.do?code=${requestScope.freeBoard.code}&page=${param.page}">수정</a> |
	<a href="/${initParam.rootPath }/freeboard/deleteContent.do?code=${requestScope.freeBoard.code}&page=${param.page}">삭제</a> |
	<a href="/${initParam.rootPath }/freeboard/list.do?page=${param.page}">목록</a> |
</div>

























